Carbon


InsertMenuItemText

Header: Menus.h Carbon status: Supported

Inserts a menu item into a menu.

OSStatus InsertMenuItemText (
    MenuHandle menu, 
    ConstStr255Param inString, 
    UInt16 afterItem
);
menu

A handle to the menu into which the item is to be inserted.

inString

A Pascal string containing the text of the menu item to insert. You can pass a string containing any characters, and these characters will be presented verbatim in the menu item.

afterItem

The item number of the menu item after which the new menu item is to be inserted. Specify 0 to insert the new menu item at the top of the menu, before the first menu item. Specify a value greater than or equal to the last menu item to append the new item to the end of the menu.

function result

A result code.

DISCUSSION

The InsertMenuItemText function inserts an enabled menu item containing the specified string into a menu, without evaluating the string for metacharacters, as the pre–Mac OS 8.5 Menu Manager function InsertMenuItem does. You may wish to use InsertMenuItemText if you have a need to present non-alphanumeric characters in a menu item.

See also the AppendMenuItemText function.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when MenusLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by MenusLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)